home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 3.iso / dist / fw_qt3.idb / usr / freeware / Qt / include / qsharedmemory.h.z / qsharedmemory.h
Encoding:
C/C++ Source or Header  |  2002-04-08  |  2.1 KB  |  83 lines

  1. /****************************************************************************
  2. ** $Id:  qt/qsharedmemory.h   3.0.3   edited Jan 24 07:30 $
  3. **
  4. ** Includes system files for shared memory
  5. **
  6. ** Created : 020124
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the kernel module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed and/or modified under the terms of the
  13. ** GNU General Public License version 2 as published by the Free Software
  14. ** Foundation and appearing in the file LICENSE.GPL included in the
  15. ** packaging of this file.
  16. **
  17. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  18. ** licenses for Qt/Embedded may use this file in accordance with the
  19. ** Qt Embedded Commercial License Agreement provided with the Software.
  20. **
  21. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  22. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  23. **
  24. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  25. **   information about Qt Commercial License Agreements.
  26. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  27. **
  28. ** Contact info@trolltech.com if any conditions of this licensing are
  29. ** not clear to you.
  30. **
  31. **********************************************************************/
  32.  
  33. //
  34. //  W A R N I N G
  35. //  -------------
  36. //
  37. // This file is not part of the Qt API.  It exists for the convenience
  38. // of qapplication_qws.cpp and qgfxvnc_qws.cpp.  This header file may 
  39. // change from version to version without notice, or even be removed.
  40. //
  41. //
  42.  
  43. #if !defined(QT_QSHM_H)
  44. #define QT_QSHM_H
  45.  
  46. #if !defined(QT_NO_QSHM)
  47.  
  48.  
  49. #include <qstring.h>
  50. #include <sys/types.h>
  51. #include <sys/ipc.h>
  52.  
  53. class QSharedMemory {
  54. public:
  55.     QSharedMemory(){};
  56.     QSharedMemory(int, QString);
  57.     ~QSharedMemory(){};
  58.  
  59.     bool create();
  60.     void destroy();
  61.  
  62.     bool attach();
  63.     void detach();
  64.  
  65.     void setPermissions(mode_t mode);
  66.     void * base() { return shmBase; };
  67.  
  68. private:
  69.     void *shmBase;
  70.     int shmSize;
  71.     QString shmFile;
  72. #if defined(QT_POSIX_QSHM)
  73.     int shmFD;
  74. #else
  75.     int shmId;
  76.     key_t key;
  77.     int idInitted;
  78. #endif
  79. };
  80.  
  81. #endif
  82. #endif
  83.